package com.jvm;

import java.lang.reflect.Constructor;

public class ClassTest {

    public static void main(String[] args) throws IllegalAccessException, InstantiationException {
        // 以String.class为例
        String[] str = new String[3];
        Class cl = str.getClass();

        System.out.println(cl.getComponentType());
        Constructor[] constructors = cl.getConstructors();
        for (Constructor constructor : constructors) {
            System.out.println(constructor.getName()+": "+constructor.getParameterCount());
        }
        System.out.println(cl.getFields());
        Object o = cl.newInstance();
    }
}
